package cn.llssit.project.wechatapi.controller;

import cn.llssit.framework.web.domain.AjaxResult;
import cn.llssit.project.wechatapi.mapper.WcMovieMapper;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Lesan
 * @Date: 2020-06-27
 */
@RestController
@RequestMapping("/wechatapi")
public class WcMovieController {
    @Autowired
    private WcMovieMapper wcMovieMapper;

    @ApiOperation("")
    @GetMapping("/getHomeComingFilm")
    public AjaxResult getHomeComingFilm(){
        return AjaxResult.success(wcMovieMapper.selectHomeCome());
    }

    @ApiOperation("")
    @GetMapping("/getHomeUpcomingFilm")
    public AjaxResult getHomeUpcomingFilm(){
        return AjaxResult.success(wcMovieMapper.selectHomeNew());
    }

    @ApiOperation("")
    @GetMapping("/getShowingFilm")
    public AjaxResult getShowingFilm(String date){
        return AjaxResult.success(wcMovieMapper.selectShowing(date));
    }

    @ApiOperation("")
    @GetMapping("/getUpcomingFilmDate")
    public AjaxResult getUpcomingFilmDate(){
        return AjaxResult.success(wcMovieMapper.selectUpcomingdate());
    }

    @ApiOperation("")
    @GetMapping("/getUpcomingFilmLimit")
    public AjaxResult getUpcomingFilmLimit(){
        return AjaxResult.success(wcMovieMapper.selectUpcomingLimit());
    }
}
